package e_Collections;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;

/**
 * @author Cheng-02
 * @version V1.0
 * @Package e_Collections
 * @date 2024/4/8 下午1:43
 */
public class Test01 {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
//        static <T> boolean addAll(Collection<? super T> c,T....elements) ->批量添加元素
        Collections.addAll(list, "a", "b", "c", "d", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z","a");//批量添加元素
        System.out.println(list);
//        static void shuffle(List<?> list)->打乱元素中的顺序
        Collections.shuffle(list);//打乱元素中的顺序
        System.out.println(list);
//        static void sort(List<?> list)->将集合中的元素按照默认规则排序
        Collections.sort(list);//将集合中的元素按照默认规则排序,按照ASCII码排序
        System.out.println(list);


    }
}
